package com.cnsoft.persistent.player.U101112PlayerWeixin;

import java.util.ArrayList;
import java.util.HashMap;

import org.cnsoft.framework.apidoc.MyApiDocSupport;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 会员微信用户信息接口
 */
@CrossOrigin
@RestController
@RequestMapping(value = "/doc/1.0/base/u101112playerweixin", method = { RequestMethod.GET })
public class U101112PlayerWeixinApiDoc extends MyApiDocSupport {

	// 获得API地址
	public String loadApiDocName() throws Exception {
		return "会员微信用户信息;/doc/1.0/base/u101112playerweixin/all";
	}

	// API文档描述
	@RequestMapping(value = "/all", method = RequestMethod.GET)
	public HashMap<String, Object> loadApiDocValue() throws Exception {
		HashMap<String, Object> all = new HashMap<String, Object>();
		// 输出基本信息
		all.put("name", "会员微信用户信息");
		all.put("baseurl", "/api/1.0/base/u101112playerweixin");
		// 输出API列表
		{
			ArrayList<Object> list = new ArrayList<Object>();
			list.add("/list");
			list.add("/info");
			list.add("/append");
			list.add("/modify");
			list.add("/discard");
			all.put("apilist", list);
		}
		// 输出字段信息
		{
			ArrayList<Object> list = new ArrayList<Object>();
			HashMap<String, Object> item;
			{
				item = new HashMap<String, Object>();
				item.put("enname", "wxOpenId");
				item.put("cnname", "用户的标识");
				item.put("datatype", "String");
				item.put("memo", "用户的标识，对当前公众号唯一");

				list.add(item);
			}
			{
				item = new HashMap<String, Object>();
				item.put("enname", "subscribe");
				item.put("cnname", "用户是否订阅该公众号标识");
				item.put("datatype", "String");
				item.put("memo", "值为0时，代表此用户没有关注该公众号，拉取不到其余信息。");

				list.add(item);
			}
			{
				item = new HashMap<String, Object>();
				item.put("enname", "nickName");
				item.put("cnname", "昵称");
				item.put("datatype", "String");
				item.put("memo", "");

				list.add(item);
			}
			{
				item = new HashMap<String, Object>();
				item.put("enname", "sex");
				item.put("cnname", "性别");
				item.put("datatype", "String");
				item.put("memo", "");

				list.add(item);
			}
			{
				item = new HashMap<String, Object>();
				item.put("enname", "city");
				item.put("cnname", "用户所在城市");
				item.put("datatype", "String");
				item.put("memo", "");

				list.add(item);
			}
			{
				item = new HashMap<String, Object>();
				item.put("enname", "province");
				item.put("cnname", "用户所在省份");
				item.put("datatype", "String");
				item.put("memo", "");

				list.add(item);
			}
			{
				item = new HashMap<String, Object>();
				item.put("enname", "country");
				item.put("cnname", "用户所在国家");
				item.put("datatype", "String");
				item.put("memo", "");

				list.add(item);
			}
			{
				item = new HashMap<String, Object>();
				item.put("enname", "headImgUrl");
				item.put("cnname", "头像URL");
				item.put("datatype", "String");
				item.put("memo", "");

				list.add(item);
			}
			{
				item = new HashMap<String, Object>();
				item.put("enname", "subscribeTime");
				item.put("cnname", "用户关注时间，为时间戳");
				item.put("datatype", "String");
				item.put("memo", "");

				list.add(item);
			}
			{
				item = new HashMap<String, Object>();
				item.put("enname", "unionid");
				item.put("cnname", "微信唯一识别ID");
				item.put("datatype", "String");
				item.put("memo", "");

				list.add(item);
			}
			{
				item = new HashMap<String, Object>();
				item.put("enname", "remark");
				item.put("cnname", "公众号运营者对粉丝的备注");
				item.put("datatype", "String");
				item.put("memo", "");

				list.add(item);
			}
			all.put("itemlist", list);
		}

		return all;
	}

}
